In a servo control apparatus for performing position control, conventionally, such a servo loop, for example, as shown in FIG. 1 has been provided. In the drawing, the servo control apparatus is constituted by: a command decode circuit 1 which serves to decode a command supplied from a numerical control system (not shown) to the servo control apparatus to thereby obtain a speed, a quantity of displacement pulse, and the like; a pulse distribution circuit 2 which serves to generate a predetermined command pulse on the basis of the output of the command decode circuit 1; a position control circuit 3 which serves to perform position control so as to make any difference between the command pulse and a position feedback signal equal to zero; a speed control circuit 4 which serves to control the speed in accordance with the speed command from the position control circuit 3; a servo motor 5; a position detector 6 which serves to detect the rotational position of the servo motor 5; a free run counter 7 which has a function of an up/down counter for counting a feedback pulse from the position detector 6 in the positive and negative directions; a subtraction circuit 7a which serves to obtain the difference between the current and the preceding output count values of the free run counter 7; and a cycle counter 8 which is constituted by an up/down counter similar to the free run counter 7 but is preset by a Z-phase pulse, that is, a reference pulse produced from the position detector 6 at a reference position in every rotation.
Next, the operation of the servo loop will be described. The command decode circuit 1 decodes a command supplied to the servo control apparatus to thereby produce a speed, a quantity of displacement pulse, and the like. The pulse distribution circuit 2 produces, as a position command, a quantity of displacement pulse per predetermined unit time on the basis of the speed, the quantity of displacement pulse, and the like obtained in the command decode circuit 1. The position control circuit 3 produces a speed command so that the servo motor 5 is driven through the speed control circuit 4 so as to make the difference between the position command and a position feedback equal to zero. The position detector 6 is connected to the servo motor 5 so as to produce a feedback pulse corresponding to the rotational angular position and direction of the servo motor 5. The free run counter 7 counts the feedback pulse and the subtraction circuit 7a feeds back a difference between current and preceding count values of the free run counter 7 to the position control circuit 3 as the quantity of displacement pulse per unit time of the servo motor 5. Further, the cycle counter 8 counts the feedback pulse supplied from the position detector 6 similarly to the free run counter 7. The cycle counter 8 is preset by the Z-phase pulse supplied from the position detector 6 so that the cycle counter 8 detects a reference point return which the position control circuit 3 performs to set the system of coordinates upon turning-on of a power source and magnetic pole positions of the servo motor 5 when the servo motor 5 is an AC induction motor, the output of the cycle counter 8 being feedback to the pulse distribution circuit 2.
Being configured as described above, the conventional position control system has a problem in that if the feedback pulse from the position detector 6 is erroneously counted, it becomes impossible to perform positioning to a commanded position correctly, for example, in an NC machine tool or the like.
As an example of application of the above servo loop, there has been known such a conventional servo control apparatus as FIG. 2 which performs position control, for example, of a tool or a work table in an NC machine tool or the like.
In FIG. 2, the circuit configuration includes: a command decode circuit 1 which serves to decode a displacement command supplied to the servo control apparatus to thereby obtain a speed, a quantity of displacement, and the like; a pulse distribution circuit 2 which serves to produce, as a command pulse, a quantity of displacement pulse per unit time on the basis of the speed and the quantity of displacement produced from the command decode circuit 1; a position control circuit 3 which serves to produce a speed command so that the difference between the command pulse produced from the pulse distribution circuit 2 and a position feedback is made equal to zero; a speed control circuit 4 which serves to control the revolving speed of a servo motor 5 in accordance with the speed command from the position control circuit 3; a position detector 6a which serves to detect a current rotational position of the servo motor 5 and to output the current rotational position as a feedback pulse; a revolving number detector 6b which serves to detect the current revolving number of the servo motor 5; and an angle detector 6c which serves to detect the current angle of the servo motor 5 in every rotation, the angle detector 6c constituting, together with the position detector 6a and the revolving number detector 6b, an absolute position detector for the servo motor 5.
The circuit configuration further includes: a free run counter 7 constituted by an up/down counter which serves to count the output pulse of the position detector 6a; a feedback pulse generation circuit 7a which serves to generate a position feedback pulse on the basis of the output of the free run counter 7; and a revolving number counter 10 constituted by an up/down counter which serves to count the output pulse of the revolving number detector 6b.
The circuit configuration further includes a reference revolving number memory 11 which serves to store in advance the count value of the revolving number counter 10 produced at a reference point in accordance with a reference point storage command supplied from the command decode circuit 1; a reference angle memory 12 which serves to store in advance the output of the angle detector 6c produced at the reference point in accordance with the same reference point storage command; and a back-up battery 13 which serves to hold the respective output values of the revolving number counter 10, the reference revolving number memory, and the reference angle memory 12 upon turning-off of the power supply.
The circuit configuration further includes an absolute position detection circuit 14 which serves to obtain the current absolute position of the servo motor 5 on the basis of the respective outputs of the reference revolving number memory 11, the revolving number counter 10, the reference angle memory 12, and the angle detector 6c.
Next, the operation of the thus configured servo control apparatus will be described. A command applied from an NC tape or the like to the servo control apparatus is decoded by the command decode circuit 1 so that a speed, a quantity of displacement, and the like are obtained. The speed, the quantity of displacement, and the like are supplied to the pulse distribution circuit 2. The pulse distribution circuit 2 calculates a quantity of displacement pulse per predetermined unit time, and supplies the thus obtained quantity of displacement pulse, as a position command pulse, to the position control circuit 3. The position control circuit 3 calculates a speed command so as to make the difference between the applied position command pulse and a position feedback pulse equal to zero, and supplies the thus obtained speed command to the speed control circuit 4. The speed control circuit 4 drives the servo motor 5 in accordance with the speed command supplied thereto.
The position detector 6a connected to the servo motor 5 produces a pulse corresponding to the current rotational direction and angle of the servo motor 5. The free run counter 7 counts the pulse supplied from the position detector 6a. The feedback pulse generation circuit 7a calculates a difference between the current count value of the free run counter 7 and the accumulated count value of the free run counter 7 till the current count value of the same. The difference is supplied to the position control circuit 3 as a position feedback pulse per unit time of the servo motor 5.
In such a control system, it is necessary to establish the system of coordinates in order to detect the rotational position of the servo motor 5 to thereby control the servo motor 5. Then, description will be made hereunder as to the operation in determining the system of coordinates.
The revolving number detector 6b produces, in every rotation of the servo motor 5, a revolving pulse corresponding to the current revolving, that is, the current revolving number and direction of the servo motor 5 and supplies the produced revolving pulse to the revolving number counter 10 so that the revolving number counter 10 counts the current revolving number of the servo motor 5. The angle detector 6c detects the current angle of the servo motor 5 in every rotation.
Further, the reference revolving number memory 11 and the reference angle memory 12 store, in advance, the count value and the angle value which are produced from the revolving number counter 10 and the angle detector 6c, respectively, at the reference point in accordance with a reference point storage command supplied from the command decode circuit 1.
Then, the current count value representing the current of revolving number of the servo motor 5 produced from the revolving number counter 10, the reference revolving number of the same at the reference point stored in advance in the reference revolving number memory 11, the current angle value detected by the angle detector 6c, and the reference angle value at the reference point stored in advance in the reference angle memory 12 are supplied to the absolute position detection circuit 14.
The absolute position detection circuit 14 calculates a difference between the current revolving number of the servo motor 5 produced from the revolving number counter 10 and the reference revolving number of the same at the reference point stored in advance in the reference revolving number memory 11 to thereby obtain the quantity of rotation of the servo motor 5 from the reference point. Further, the absolute position detection circuit 14 calculates a difference between the current angle in every rotation of the servo motor 5 produced from the angle detector 6c and the reference angle of the same at the reference point stored in advance in the reference angle memory 12 to thereby obtain the necessary quantity of angle of the servo motor 5 from the reference point. Then, the absolute position detection circuit 14 adds the thus obtained angle to the foregoing quantity of rotation of the servo motor 5 to thereby detect the absolute position of the servo motor 5. The absolute position is detected first upon turning on the power source of the servo control apparatus and the detected absolute position is made to be the system of coordinates of the command decode circuit 1. Thereafter, position control of the servo motor 5 is quickly performed on the basis of the system of coordinates.
Being configured as described above, the conventional servo control apparatus has a problem in that, although the system of coordinate of the command decode circuit 1 can be established immediately as soon as the power source of the servo control apparatus is turned on, it is impossible to confirm an error in the output pulse of the revolving number detector 6b, in the counting of the revolving number counter 10, or the like, so that the absolute position may shift thereby making it impossible to control the servo motor 5 to a correct position in the case where an error occurs in the output pulse of the revolving number detector 6b or in the counting of the revolving number counter 10.